
class Food {
    ele: HTMLElement;
    constructor() {
        this.ele = document.getElementById('food')!;
    }
    get x () {
        return this.ele.offsetLeft;
    }

    get y () {
        return this.ele.offsetTop;
    }

    changePosition() {
        const randomX = Math.floor(Math.random() * 30) * 10,
              randomY = Math.floor(Math.random() * 30) * 10;
        this.ele.style.top = randomY + 'px'
        this.ele.style.left = randomX + 'px'
        return this.ele
    }
}

export default Food